<template>
  <Layout>
    <Wtable
      v-loading="students.loading"
      :data="students.list"
      :order="false"
      :total="students.query.total_"
      :pageSize="students.query.pageSize_"
      :pageNum="students.query.pageNum_"
      @page-change="handleCurrentChange"
      :selection="false"
      @selection-change="handleSelectionChange"
    >
      <el-table-column
        prop="studentId"
        label="学号"
        fixed="left"
        width="100px"
      />
      <el-table-column prop="name" label="姓名" width="100px" />
      <el-table-column prop="facultyI18n" label="学院" width="100px" />
      <el-table-column prop="cultureProfessionI18n" label="培养专业" />
      <el-table-column prop="trainingLevelI18n" label="培养类别" />
      <el-table-column prop="campusI18n" label="校区" />
      <el-table-column label="操作" fixed="right" width="120">
        <template #default>
          <el-link type="primary" @click="viewDetail(scope.row)">detail</el-link>
        </template>
      </el-table-column>
    </Wtable>
  </Layout>
</template>

<script>
export default{
  name:'page1'
}
</script>

<script setup>
import api from "@/api/index";
import {aa,getRoomInfo,test} from "@/hooks/index";

// table列表业务
const students = reactive({
  list: [],
  loading: false,
  query: {
    total_: 0,
    pageSize_: 7,
    pageNum_: 1,
  },
});

const testIns = test()
// console.log(testIns.getData())

let getData = async () => {
  students.loading = true;
  let res = await api.student.findStuInfoList(students.query);
  students.loading = false;
  students.list = res.data.list;
  students.query.total_ = res.data.total_;
};

// onMounted(() => {
//   getData();
// });

let handleCurrentChange = (pages) => {
  students.query.pageNum_ = pages.pageNum;
  students.query.pageSize_ = pages.pageSize;
  getData();
};
let handleSelectionChange = (row, expandedRows) => {
  console.log("handleSelectionChange");
  console.log(row);
};
let handleRefreshClick = () => {
  console.log("handleRefreshClick");
  getData()
};

onMounted(() => {
  console.log('page1');
});
// table列表业务 End
</script>

<style lang="scss" scoped></style>
